package com.zark.myspringboot.web.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("index")
public class IndexController {

	@RequestMapping(value = { "/index/{param}", "/home/{param}" }, method = { RequestMethod.GET, RequestMethod.POST })
	public String index(@PathVariable(name = "param") String param) {
		return "params=" + param;
	}

	@RequestMapping(value = "error", method = { RequestMethod.GET, RequestMethod.POST })
	public void error() {
		System.out.println(1 / 0);
	}

}